const {createProxyMiddleware} = require('http-proxy-middleware');

const host = `http://127.0.0.1:8090`;

const proxys = [
  {
    url: "/qk/app/ws",
    config: {
      target: host,
      changeOrigin: true,
      ws: true,
      cookieDomainRewrite: "http://localhost:3002",
    },
  },
  {
    url: "/api",
    config: {
      target: host,
      changeOrigin: true,
      // cookieDomainRewrite: "http://localhost:3002",
    },
  },
]

module.exports = function (app) {
  for (const item of proxys) {
    app.use(item.url, createProxyMiddleware(item.config));
  }
};

